﻿//-------------------------------------
// WBFSSync - WBFSSync.exe
//
// Copyright 2009 Caian (ÔmΣga Frøst) <frost.omega@hotmail.com> :
//
// WBFSSync is Licensed under the terms of the Microsoft Reciprocal License (Ms-RL)
//
// AeroSplitContainer.cs:
//
// Um container que desenha uma linha entre os 2 paineis estilo explorer
//
//-------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace WBFSSync.AeroControls
{
    class AeroSplitContainer : SplitContainer
    {
        //----------------------- Rotinas

        public AeroSplitContainer() : base()
        {
            DoubleBuffered = true;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            if(Orientation == Orientation.Horizontal)
            {
                int linepos = (Panel2.Top + Panel1.Bottom) / 2;
                e.Graphics.DrawLine(new Pen(Color.FromArgb(214, 229, 245), 1.0f), 0, linepos, Width, linepos);
            }
            else
            {
                int linepos = (Panel2.Left + Panel1.Right) / 2;
                e.Graphics.DrawLine(new Pen(Color.FromArgb(214, 229, 245), 1.0f), linepos, 0, linepos, Height);
            }
        }
    }
}
